<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

	<head lang="en">
		<meta charset="utf-8" />
		<title>个人信息</title>
		<link rel="stylesheet" type="text/css" href="../../css/public.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/mygxin.css" />
	</head>
	<body>
		<!------------------------------head------------------------------>
<!--		<div class="head ding">-->
<!--			<div class="wrapper clearfix">-->
<!--				<div class="clearfix" id="top">-->
<!--					<h1 class="fl"><a href="index"><img src="../../img/logo2.png"/></a></h1>-->
<!--					<div class="fr clearfix" id="top1">-->
<!--						<p class="fl">-->
<!--							<a href="login" id="login">登录</a>-->
<!--							<a href="reg" id="reg">注册</a>-->
<!--						</p>-->
<!--						<form action="#" method="get" class="fl">-->
<!--							<input type="text" placeholder="搜索" />-->
<!--							<input type="button" />-->
<!--						</form>-->
<!--						<div class="btn fl clearfix">-->
<!--							<a href="mygxin"><img src="../../img/grzx.png"/></a>-->
<!--							<a href="#" class="er1"><img src="../../img/ewm.png"/></a>-->
<!--							<a href="cart"><img src="../../img/gwc.png"/></a>-->
<!--							<p><a href="#"><img src="../../img/smewm.png"/></a></p>-->
<!--						</div>-->
<!--					</div>-->
<!--				</div>-->
<!--				<ul class="clearfix" id="bott">-->
<!--					<li><a href="index">首页</a></li>-->
<!--					<li>-->
<!--						<a href="#">所有商品</a>-->
<!--						<div class="sList">-->
<!--							<div class="wrapper  clearfix">-->
<!--								<a th:each="category,categoryStat:${category}" th:href="@{/front/getcategory/{categoryId}(categoryId=${category.categoryId})}">-->
<!--									<dl>-->
<!--										<dt><img src="../../img/nav1.jpg"/></dt>-->
<!--										<dd th:text="${category.name}"></dd>-->
<!--									</dl>-->
<!--								</a>-->
<!--							</div>-->
<!--						</div>-->
<!--					</li>-->
<!--					<li th:each="category,categoryStat:${category}">-->
<!--						<a th:href="@{/front/getcategory/{categoryId}(categoryId=${category.categoryId})}">-->
<!--							<span th:text="${category.name}"></span>-->
<!--						</a>-->
<!--					</li>-->
<!--				</ul>-->
<!--			</div>-->
<!--		</div>-->
		<div th:replace="~{front/public/topmargin::topbar}"></div>
		<!------------------------------idea------------------------------>
		<div class="address mt" id="add">
			<div class="wrapper clearfix">
				<a href="index" class="fl">首页</a>
				<span>/</span>
				<a href="mygxin" class="on">个人中心</a>
			</div>
		</div>
		
		<!------------------------------Bott------------------------------>
		<div class="Bott">
			<div class="wrapper clearfix">
<!--				<div class="zuo fl">-->
<!--					<h3>-->
<!--						<a href="#"><img src="../../img/tx.png"/></a>-->
<!--						<p class="clearfix"><span class="fl" th:text="${session.username}"></span><span class="fr">[退出登录]</span></p>-->
<!--					</h3>-->
<!--					<div>-->
<!--						<h4>我的交易</h4>-->
<!--						<ul>-->
<!--							<li><a href="cart">我的购物车</a></li>-->
<!--							<li><a href="myorderq">我的订单</a></li>-->
<!--							<li><a href="myprod">评价晒单</a></li>-->
<!--						</ul>-->
<!--						<h4>个人中心</h4>-->
<!--						<ul>-->
<!--							<li  class="on"><a href="mygxin">我的中心</a></li>-->
<!--							<li><a href="address">地址管理</a></li>-->
<!--							<li><a href="release">订单发布</a></li>-->
<!--						</ul>-->
<!--						<h4>账户管理</h4>-->
<!--						<ul>-->
<!--							<li><a href="mygrxx">个人信息</a></li>-->
<!--							<li><a href="remima">修改密码</a></li>-->
<!--						</ul>-->
<!--					</div>-->
<!--				</div>-->
				<div th:replace="~{front/public/sidebar::leftbar}"></div>
				<div class="you fl">
					<div class="tx clearfix">
						<div class="fl clearfix">
							<a href="#" class="fl"><img id="img-avatar2" src="../../img/tx.png" width="90px" height="90px"/></a>
							<p class="fl"><br><br><a><span type="text" class="fl" style="color: black; font-size: 15px" id="usernameAgain"></span></a></p><br>
							<p class="fl"><a href="mygrxx">修改个人信息></a></p>
						</div>

						<div class="fr" type="text" id="email"></div>
<!--						<span type="text" class="fl" style="color: black; font-size: 15px" id="email"></span>-->
					</div>
					<div class="bott">
						<div class="clearfix">
							<a href="#" class="fl"><img src="../../img/gxin1.jpg"/></a>
							<p class="fl"><span >待支付的订单：<strong id="waitToPayOrders">0</strong></span>
								<a href="myorderq">查看待支付订单></a>
							</p>
						</div>
						<div class="clearfix">
							<a href="#" class="fl"><img src="../../img/gxin2.jpg"/></a>
							<p class="fl"><span >待收货的订单：<strong id="waitToreceiveOrders">0</strong></span>
								<a href="myorderq">查看待收货订单></a>
							</p>
						</div>
						<div class="clearfix">
							<a href="#" class="fl"><img src="../../img/gxin3.jpg"/></a>
							<p class="fl"><span >待评价的订单：<strong id="waitToEvaluateOrders">0</strong></span>
								<a href="myprod">查看待评价订单></a>
							</p>
						</div>
<!--						<div class="clearfix">-->
<!--							<a href="#" class="fl"><img src="../../img/gxin4.jpg"/></a>-->
<!--							<p class="fl"><span>喜欢的商品：<strong>0</strong></span>-->
<!--								<a href="#">查看喜欢的商品></a>-->
<!--							</p>-->
<!--						</div>-->
						<div class="clearfix">
							<a href="#" class="fl"><img src="../../img/gxin4.jpg"/></a>
							<p class="fl"><span>待发货的订单：<strong id="waitTodeliverOrders">0</strong></span>
								<a href="myorderq">查看待发货订单></a>
							</p>
						</div>


					</div>
				</div>
			</div>
		</div>



		<!--返回顶部-->
		<div th:replace="~{front/public/gotop::endbar}"></div>
		<div class="footer">
			<div class="top">
				<div class="wrapper">
					<div class="clearfix">
						<a href="#2" class="fl"><img src="../../img/foot1.png"/></a>
						<span class="fl">7天无理由退货</span>
					</div>
					<div class="clearfix">
						<a href="#2" class="fl"><img src="../../img/foot2.png"/></a>
						<span class="fl">15天免费换货</span>
					</div>
					<div class="clearfix">
						<a href="#2" class="fl"><img src="../../img/foot3.png"/></a>
						<span class="fl">满599包邮</span>
					</div>
					<div class="clearfix">
						<a href="#2" class="fl"><img src="../../img/foot4.png"/></a>
						<span class="fl">手机特色服务</span>
					</div>
				</div>
			</div>
			<p class="dibu">最家家居&copy;2013-2017公司版权所有 京ICP备080100-44备0000111000号<br />
			违法和不良信息举报电话：400-800-8200，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</p>
		</div>
		<script src="../../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/public.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/user.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	</body>
    <script type="text/javascript">
		$(document).ready(function () {
			console.log("from code itself1")
			console.log("cookie中的avatar=" + $.cookie("photo"));
			$("#img-avatar").attr("src", $.cookie("photo"));
			$("#img-avatar2").attr("src", $.cookie("photo"));
		});
		$.ajax({
			url: "/getUserInfo",
			type: "GET",
			dataType: "json",
			success: function(json) {
				if (json.state == 200) {
					console.log("username=" + json.data.username);
					console.log("email=" + json.data.email);
					$("#username").val(json.data.username);
					$("#email").val(json.data.email);
					$("#usernameAgain").text(json.data.username);
					$("#email").text(json.data.email);

				} else {
					alert("获取用户信息失败！" + json.message);
				}
			}
		});

			//待支付的订单状态
			var status=1
			//待发货的订单状态
			var status2=2
			//待收货的订单状态
			var status3=3
			//待评价的订单状态
			var status4=4

			//	获取订单状态的数量
			$.ajax({
				url: "/front/showCountOrderStatus",
				type: "post",
				dataType: "json",
				data:{status:status},
				success: function(data) {
					if (data.code == 1) {
						console.log(data.data)
						$("#waitToPayOrders").text(data.data);
					} else {
						console.log('获取失败')
					}
				}
			});
			$.ajax({
			url: "/front/showCountOrderStatus",
			type: "post",
			dataType: "json",
			data:{status:status3},
			success: function(data) {
				if (data.code == 1) {
					console.log(data.data)
					$("#waitToreceiveOrders").text(data.data);
				} else {
					console.log('获取失败')
				}
			}
		});
			$.ajax({
				url: "/front/showCountOrderStatus",
				type: "post",
				dataType: "json",
				data:{status:status2},
				success: function(data) {
					if (data.code == 1) {

						$("#waitTodeliverOrders").text(data.data);
					} else {
						console.log('获取失败')
					}
				}
			});
			$.ajax({
				url: "/front/showCountOrderStatus",
				type: "post",
				dataType: "json",
				data:{status:status4},
				success: function(data) {
					if (data.code == 1) {
						$("#waitToEvaluateOrders").text(data.data);
					} else {
						console.log('获取失败')
					}
				}
			});




	</script>
</html>
